<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	BaseForm form = (BaseForm)request.getAttribute("command");
	String tab = form.getTab();
	String defaultSiteId = request.getAttribute("defaultSiteId")+"";
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String userid = user.getUsername();
	String siteid = user.getSiteId();
	String deptid = user.getDeptId();
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
	String year_moth = sdf.format(new Date());
	sdf = new SimpleDateFormat("yyyy-MM-dd");
	String currentDate = sdf.format(new Date());
%>
<div id="childLayout" class="easyui-layout" data-options="fit:true">
	<div data-options="region:'west',split:true,maxWidth:220,collapsible:true,style:{borderWidth:2},onResize:function(){XF.LAYOUT.resizeWest();}" style="background: #f7f7f9;width:220px;" title=" ">
		 <div class="sidebar">
			<div id="sidebar" class="easyui-accordion" style="width:auto;height:auto;">  
			
				<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_READ_SHIFT,CHECK_ADD_SHIFT,CHECK_DELETE_SHIFT,CHECK_EDIT_SHIFT">
					<div title="班次管理"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_SHIFT">
								<li class="site-li">
									<a s="addShift" href="javascript:XF.Check.addShift()"><span>增加班次</span></a>
								</li>
							</sec:authorize>
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_READ_SHIFT,CHECK_DELETE_SHIFT,CHECK_EDIT_SHIFT">
							<li class="site-li">
								<a s="shiftList" href="javascript:XF.Check.shiftList('<%=defaultSiteId%>')"><span>班次列表</span></a>
							</li>
							</sec:authorize>
		
						</ul>
					</div>
				</sec:authorize>
				<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_SCHEDULE,CHECK_DELETE_SCHEDULE,CHECK_EDIT_SCHEDULE,CHECK_READ_SCHEDULE">
					<div title="排班管理"  style="overflow:auto;padding:10px;"> 
						<ul class="site-ul">
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_SCHEDULE">
							<li class="site-li">
								<a s="addSchedule" href="javascript:XF.Check.addSchedule()"><span>人员排班</span></a>
							</li>
							</sec:authorize>
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_DELETE_SCHEDULE,CHECK_EDIT_SCHEDULE,CHECK_READ_SCHEDULE">
							<li class="site-li">
								<a s="scheduleList" href="javascript:XF.Check.scheduleList()"><span>排班列表</span></a>
							</li>
							</sec:authorize>
						</ul>
					</div>
				</sec:authorize>				
				<sec:authorize ifAnyGranted="LEAVE_MEND_PERSON_CHECK,LEAVE_MEND_DEPT_CHECK,LEAVE_MEND_CHECK,LEAVE_MEND_SITE_CHECK">
					<div title="请假和补卡管理"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">							
							<sec:authorize ifAnyGranted="LEAVE_MEND_CHECK">
							<li class="site-li">
								<a s="addLeave" href="javascript:XF.Check.addLeave()"><span>员工请假登记</span></a>
							</li>
							<li class="site-li">
								<a s="leaveList" href="javascript:XF.Check.leaveList('<%=year_moth %>','<%=userid %>')"><span>员工请假管理</span></a>
							</li>
							<li class="site-li">
								<a s="addMend" href="javascript:XF.Check.addMend()"><span>员工补卡登记</span></a>
							</li>
							<li class="site-li">
								<a s="mendList" href="javascript:XF.Check.mendList('<%=year_moth %>','<%=userid %>')"><span>员工补卡管理</span></a>
							</li>
							</sec:authorize>
							<sec:authorize ifAnyGranted="LEAVE_MEND_DEPT_CHECK">
							<li class="site-li">
								<a s="leaveDeptList" href="javascript:XF.Check.leaveDeptList('<%=year_moth %>','<%=siteid %>','<%=deptid %>')"><span>部门请假管理</span></a>
							</li>
							<li class="site-li">
								<a s="mendDeptList" href="javascript:XF.Check.mendDeptList('<%=year_moth %>','<%=siteid %>','<%=deptid %>')"><span>部门补卡管理</span></a>
							</li>
							</sec:authorize>							
							<sec:authorize ifAnyGranted="LEAVE_MEND_PERSON_CHECK">
							<li class="site-li">
								<a s="addPersonLeave" href="javascript:XF.Check.addPersonLeave()"><span>人事部请假登记</span></a>
							</li>
							<li class="site-li">
								<a s="leavePersonList" href="javascript:XF.Check.leavePersonList('<%=year_moth %>','<%=defaultSiteId %>')"><span>人事部请假管理</span></a>
							</li>
							<li class="site-li">
								<a s="addPersonMend" href="javascript:XF.Check.addPersonMend()"><span>人事部补卡登记</span></a>
							</li>
							<li class="site-li">
								<a s="mendPersonList" href="javascript:XF.Check.mendPersonList('<%=year_moth %>','<%=defaultSiteId %>')"><span>人事部补卡管理</span></a>
							</li>
							</sec:authorize>
						</ul>
					</div>
				</sec:authorize>					
				<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_HOLIDAY,CHECK_DELETE_HOLIDAY,CHECK_EDIT_HOLIDAY,CHECK_READ_HOLIDAY">
					<div title="节假日管理"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_HOLIDAY">
							<li class="site-li">
								<a s="addHoliday" href="javascript:XF.Check.addHoliday()"><span>节假日登记</span></a>
							</li>
							</sec:authorize>
							<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_HOLIDAY,CHECK_DELETE_HOLIDAY,CHECK_EDIT_HOLIDAY">
							<li class="site-li">
								<a s="holidayList" href="javascript:XF.Check.holidayList()"><span>节假日列表</span></a>
							</li>
							</sec:authorize>						
						</ul>
					</div>
				</sec:authorize>
					
				<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_DATA,CHECK_READ_DATA">
				<div title="考勤原始数据"  style="overflow:auto;padding:10px;">  
					<ul class="site-ul">
<%-- 						<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ADD_DATA">
						<li class="site-li">
							<a s="addData" href="javascript:XF.Check.addData()"><span>上传原始数据</span></a>
						</li>
						</sec:authorize> --%>
						<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_READ_DATA">
						<li class="site-li">
							<a s="dataList" href="javascript:XF.Check.dataList('<%=defaultSiteId%>')"><span>原始数据列表</span></a>
						</li>	
						<li class="site-li">
							<a s="dataSummaryList" href="javascript:XF.Check.dataSummaryList()"><span>原始数据统计</span></a>
						</li>
						<li class="site-li">
							<a s="checkDatailReportList" href="javascript:XF.Check.checkDatailReportList('<%=defaultSiteId%>','<%=deptid%>','<%=currentDate%>')"><span>考勤报表</span></a>
						</li>
						<li class="site-li">
							<a s="checkSitesReportList" href="javascript:XF.Check.checkSitesReportList('','<%=currentDate%>')"><span>分公司考勤率统计</span></a>
						</li>						
						</sec:authorize>
					</ul>
				</div>	
				</sec:authorize>
				
				<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ANALYZE,CHECK_DAILY_REPORT,CHECK_SUMMARY_REPORT">
				<div title="考勤报表"  style="overflow:auto;padding:10px;">  
					<ul class="site-ul">
						<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ANALYZE">
						<li class="site-li">
							<a s="analyze" href="javascript:XF.Check.analyze()"><span>考勤分析</span></a>
						</li>
						</sec:authorize>
						<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ANALYZE,CHECK_DAILY_REPORT">
						<li class="site-li">
							<a s="reportList" href="javascript:XF.Check.reportList()"><span>考勤汇总表</span></a>
						</li>	
						</sec:authorize>
<%-- 						<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_ANALYZE,CHECK_SUMMARY_REPORT">
						<li class="site-li">
							<a s="summaryList" href="javascript:XF.Check.summaryList()"><span>考勤汇总表</span></a>
						</li>
						</sec:authorize>	 --%>										
					</ul>
				</div>
				</sec:authorize>		
				
				<sec:authorize ifAllGranted="MANAGE_CHECK">
					<div title="权限控制"  style="overflow:auto;padding:10px;">  
						<ul class="site-ul">
							<li class="site-li">
								<a s="userList" href="javascript:XF.Check.userList('<%=defaultSiteId%>')"><span>员工管理</span></a>
							</li>
							<li class="site-li">
								<a s="addRole" href="javascript:XF.Check.addRole()"><span>新增角色</span></a>
							</li>		
							<li class="site-li">
								<a s="roleList" href="javascript:XF.Check.roleList('<%=defaultSiteId%>')"><span>角色列表</span></a>
							</li>				
						</ul>
					</div>
				</sec:authorize>
				
				<sec:authorize ifAllGranted="MANAGE_CHECK">
					<div title="考勤机管理"  style="overflow:auto;padding:10px;">  
					<ul class="site-ul">
						<li class="site-li">
							<a s="addEmployee" href="javascript:XF.Check.addEmployee()"><span>添加员工</span></a>
						</li>
						<li class="site-li">
							<a s="listEmployee" href="javascript:XF.Check.listEmployee()"><span>员工管理</span></a>
						</li>												
					</ul> 
					</div>
				</sec:authorize>
				
			</div>
		</div>
	</div>
	<div id="checkCenter" class="siteCenter" data-options="region:'center'">
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#childLayout').layout();
		XF.NAV.activeTab('"<%=tab%>"');
	    $('#sidebar').accordion({
	        animate:true
	    });
	});
</script>
</html>